import asyncio


async def task(name, duration):
    print(f"Task {name} started")
    await asyncio.sleep(duration)
    print(f"Task {name} finished")


async def main():
    tasks = [
        task("A", 2),
        task("B", 1),
        task("C", 3)
    ]
    done, pending = await asyncio.wait(tasks, return_when=asyncio.ALL_COMPLETED)
    print(f"Done: {len(done)}, Pending: {len(pending)}")


asyncio.run(main())